﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using HM.DataLayer;

namespace HM.BusinessLayer
{
    public class BusinessLogic
    {
        private DataAccess dal = new DataAccess();

        #region Add

        public void AddTenant(Tenant tenant)
        {
            dal.AddTenant(tenant);
        }

        public void AddPayment(Payment payment)
        {
            dal.AddPayment(payment);
        }

        public void AddExpense(Expense expense)
        {
            dal.AddExpense(expense);
        }

        public void AddRegularExpense(RegularExpense regularExpense)
        {
            dal.AddRegularExpense(regularExpense);
        }

        #endregion

        #region Get

        public IEnumerable<Tenant> GetTenants()
        {
            return dal.GetTenants();
        }

        public IEnumerable<Payment> GetPayments()
        {
            return dal.GetPayments();
        }

        public IEnumerable<Payment> GetPaymentsByTenantsId(int tenantId)
        {
            return dal.GetPaymentsByTenantsId(tenantId);
        }

        public IEnumerable<Payment> GetPaymentsByDateRange(DateTime from, DateTime to)
        {
            return dal.GetPaymentsByDateRange(from, to);
        }

        public IEnumerable<RegularExpense> GetRegularExpenses()
        {
            return dal.GetRegularExpenses();
        }

        public IEnumerable<Expense> GetExpenses()
        {
            return dal.GetExpenses();
        }

        public IEnumerable<Expense> GetExpensesByDateRange(DateTime from, DateTime to)
        {
            return dal.GetExpensesByDateRange(from, to);
        }

        public Decimal? GetCash()
        {
            return dal.GetCash();
        }

        public Decimal? GetCashForThisMonth()
        {
            return dal.GetCashForThisMonth();
        }

        #endregion
        
        #region Save

                public void SaveTenants(IEnumerable<Tenant> tenants)
        {
            dal.SaveTenants(tenants);
        }

        public void SaveRegularExpenses(IEnumerable<RegularExpense> regularExpenses)
        {
            dal.SaveRegularExpenses(regularExpenses);
        }

        public void SaveExpenses(IEnumerable<Expense> expenses)
        {
            dal.SaveExpenses(expenses);
        }

        public void SavePayments(IEnumerable<Payment> payments)
        {
            dal.SavePayments(payments);
        }

        #endregion

        #region Remove

        public void RemoveTenant(Tenant tenant)
        {
            dal.RemoveTenant(tenant);
        }

        public void RemoveRegularExpense(RegularExpense regularExpence)
        {
            dal.RemoveRegularExpense(regularExpence);
        }

        public void RemoveExpense(Expense expence)
        {
            dal.RemoveExpense(expence);
        }

        public void RemovePayment(Payment payment)
        {
            dal.RemovePayment(payment);
        }

        #endregion
    }
}
